package com.lqd.demo.springboot.mail;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class MailController {

	@Autowired
	private MailService mailService;
	
	private String to = "695775009@qq.com";
	
	@RequestMapping("/mail")
	public String mail()
	{
		return "/mail";
	}
	
	@RequestMapping("/send")
	@ResponseBody
	public String sendMail(String title)
	{
		mailService.sendSimpleMail(to, title, title);
		return "success";
	}
}
